﻿@using MealBooking.Core.Models.Meals;
@{
    MealCategory mealCategory = ViewBag.MealCategory;
    List<MealCategory> mealCategories = ViewBag.MealCategories;
    <li data-role="fieldcontain">
        <label for="MealCategory_Id">
            Select One Meal Category :
        </label>
        @if (mealCategories != null && mealCategories.Count != 0)
        {
            <select id="Category_Id" name="Category.Id">
                @if (mealCategory != null)
                {
                    <option value="@mealCategory.Id" selected="selected">@mealCategory.Name</option>
                    mealCategories.Remove(mealCategory);
                }
                @foreach (var category in mealCategories)
                {
                    <option value="@category.Id">@category.Name</option>
                }
            </select>
        }
        else
        {
            <label>
                No Meal Category Yet.</label>
        }
    </li>
}
